package com.bwie.controller;

import com.bwie.pojo.Brand;
import com.bwie.service.BrandService;
import com.bwie.utils.Result;
import com.bwie.vo.BrandVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @projectName: server-day0718-pay
 * @package: com.bwie.controller
 * @className: BrandController
 * @author: 陈彤彤
 * @description: TODO
 * @date: 2025/7/19 10:38
 * @version: 1.0
 */
@RestController
@RequestMapping("/prod/brand")
@Api(tags = "品牌管理")
public class BrandController {

    @Autowired
    BrandService brandService;

    /**
    * @param brandVo:
    * @return Result
    * @author :陈彤彤
    * @description 品牌分页列表
    * @date 2025/7/19 10:50
    */
    @ApiOperation(value = "品牌分页列表")
    @PostMapping("/brandList")
    public Result brandList(@RequestBody BrandVo brandVo){
        return brandService.brandList(brandVo);
    }

    /**
    * @param brand:
    * @return Result
    * @author :陈彤彤
    * @description 修改品牌状态
    * @date 2025/7/20 19:39
    */
    @ApiOperation(value = "修改品牌状态")
    @PostMapping("/changeStatus")
    public Result changeStatus(@RequestBody Brand brand){
        return brandService.changeStatus(brand);
    }

    /**
    * @param brand:
    * @return Result
    * @author :陈彤彤
    * @description 添加品牌信息
    * @date 2025/7/21 9:24
    */
    @ApiOperation(value = "添加品牌信息")
    @PostMapping("/addBrand")
    public Result addBrand(@RequestBody Brand brand){
        return brandService.addBrand(brand);
    }
}
